#include<bits/stdc++.h>
#define y1 Y1
#define fi first
#define endl "\n"
#define se second
#define PI acos(-1)
#define int long long
#define pb(x) push_back(x)
#define PII pair<int, int>
#define Yes cout << "Yes\n";
#define No cout << "No\n";
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define _for(i, a, b) for(int i = a; i <= b; ++i)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;

const int N = 2e5 + 10;
const int mod = 1e9 + 7;

int a[N];
int n, m, t, ret, x, y;
string s;

signed main() {
	IOS;
	cin >> t;
	while(t -- ) {
		cin >> x >> y;
		if(y % x || x > y) {
			cout << -1 << endl;
		} else {
			cout << x << " " << y << endl;
		}
	} 
	return 0;
}


